forum

home / developersection / forums / how to print nsdate using nslog?

How to print NSDate using NSLog?

marcel ethan 1678 06-Dec-2015

I want to print NSDate in NSLog, but its not printing date correctly.

NSDateFormatter *format = [NSDateFormatter new];
[format setDateFormat: @"YYYY-MM-DD"];
NSDate *date = [NSDate date];
NSLog(@"Date: %@",format);

Can anyone tell me, what's wrong in my code..!


Updated on 07-Dec-2015
Can you answer this question?

Answer

1 Answers

Liked By